<div class="dataInnBottom">

    <div class="dataHeader">
        <h4>Document</h4>
    </div>
    <div class="clr"></div>
    <div class="add-button">        
        <input type="button" value="Add Document" id="add-document-button">
    </div>
    <?php $this->addScriptPath('../application/views/scripts/'); ?>
    <?= $this->paginationControl($this->paginator, 'Sliding', 'paginator.phtml') ?>

    <div class="clr"></div>


    <table class="dataActions" width="100%" border="0" cellpadding="0" cellspacing="0" >

        <tr>
            <th>Title</th>
            <th>Cabinet</th>
            <th>Switch</th>
            <th>Status</th>
            <th class="allign-right">Actions</th>
        </tr>
        <?php foreach ($this->paginator as $item) {
 ?>
            <tr>

                <td><?php echo $item['name'] ?></td>
                <td><?php echo $item['cabinet_name'] ?></td>
                <td><?php echo $item['switch_name'] ?></td>

                <td class="colGray"><?php echo $item['status']; ?></td>
                <td class="allign-right"><a href="javascript:void(0)" onclick="deleteDocument('<?= $item['id']; ?>')"><img src="<?= $this->baseURI(); ?>images/cross.png" alt="" /></a>
                    <a href="javascript:void(0)" onclick="editDocument('<?= $item['id']; ?>')"><img src="<?= $this->baseURI(); ?>images/pencil.png" alt="" /></a>
                </td>
            </tr>
<?php } ?>


    </table>
</div>
<script>
    $( "#add-document-button" )
    .button()
    .click(function() {
        $("#add-document-form").load("<?= $this->baseURI(); ?>planning/document/add");
        $( "#add-document-form" ).dialog( "open" );
    });
</script>